package me.helllp.bootman.common.config;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;

/**
 * 页面使用freemarker模板
 * 
 * @author 林晓明
 *
 */
public class ManFreemarkerConfig {

	@Autowired
	protected freemarker.template.Configuration configuration;
	
	@Autowired
	protected org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver resolver;
	
	@Autowired
	protected org.springframework.web.servlet.view.InternalResourceViewResolver springResolver;

	/**
	 * 配置页面信息
	 */
	@PostConstruct
	public void setSharedVariable() {
		resolver.setSuffix(".ftl");
		resolver.setCache(false);
		// 为模板调用时，调用request对象的变量名
		resolver.setRequestContextAttribute("request");
		resolver.setOrder(0);
		resolver.setExposeRequestAttributes(true);
		resolver.setExposeSessionAttributes(true);
	}
}